# -*- coding:utf-8 -*-
import pymongo
def insertMG(gpcode,keys,value,desc):
    client = pymongo.MongoClient("182.61.20.41", 27017)
    db = client.dfcfdata
    db.baseinfo.insert({'_id': gpcode, keys: {"value":value,"desc":desc}})

def insertAndUpdate(gpcode,keys,value,desc):
    client = pymongo.MongoClient("182.61.20.41", 27017)
    db = client.dfcfdata
    db.baseinfo.update({'_id':gpcode}, {'$set':{keys: {"value":value,"desc":desc}}})
